const path = require('path');
const BabelLoader = require('./loaders/babel-loader')
const HtmlPlugin = require('./plugins/html-plugin')

module.exports = {
  entry:path.join(__dirname,"./src/index.js"),
  output:{
    path:path.join(__dirname,"./dist"),
    filename:"bundle.js"
  },
  resolve:{
    extensions:[".js"]
  },
  module:{
    rules:[
      {
        test:/\.js$/,
        use:[BabelLoader],
      }
    ]
  },
  plugins:[
    new HtmlPlugin({template:path.join(__dirname,"./src/index.html"),filename:"index.html"})
  ],
  devServer: {
    contentBase: path.join(__dirname, './src/index.js')
  },
}